import java.util.Scanner;

public class Main {


    //倒置字符串
    public static void reverse(char[] arr,int start,int end){
        while(start<end){
            char tmp = arr[start];
            arr[start] = arr[end];
            arr[end] = tmp;
            start++;
            end--;
        }
    }
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        String str = in.nextLine();
        char[] arr = str.toCharArray();
        reverse(arr,0,arr.length-1);
        int i = 0;
        while(i<arr.length){
            int j = i;
            while(j<arr.length && arr[j]!=' '){
                j++;
            }
            if(j<arr.length){
                reverse(arr,i,j-1);
                i = j+1;
            }else{
                reverse(arr,i,j-1);
                i=j;
            }
        }
        String res = new String(arr);
        System.out.println(res);
    }


    //买卖股票的最好时机2
    public static void main2(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int[] a = new int[n];
        for (int i = 0; i < n; i++) {
            a[i] = in.nextInt();
        }
        int[] f = new int[n];
        int[] g = new int[n];
        f[0] = -a[0];
        for (int i = 1; i < n; i++) {
            f[i] = Math.max(g[i-1]-a[i],f[i-1]);
            g[i] = Math.max(f[i-1]+a[i],g[i-1]);
        }
        int max = 0;
        for (int i = 0; i < n; i++) {
            max = Math.max(g[i],max);
        }
        System.out.println(max);
    }


    //游游的水果大礼包
    public static void main1(String[] args) {
        Scanner in = new Scanner(System.in);
        long n = in.nextInt();
        long m = in.nextInt();
        long a = in.nextInt();
        long b = in.nextInt();
        long ret = 0;
        for(long x = 0;x<=Math.min(n/2,m);x++){
            long y = Math.min(n-x*2,(m-x)/2);
            ret  = Math.max(ret,a*x+b*y);
        }
        System.out.println(ret);
    }
}
